package model.playable.structure;
import model.playable.*;
import model.visibility.*;
import model.mapping.*;
import model.map.GameTile;

/**
 *
 * @author Ryan
 */
public abstract class Structure extends Playable 
{
	int armor;
	int health;
	int maxHealth;
	int defensiveDamage;
	
	public void addUpkeep(int amount)
	{
		if(getUpkeep() < amount)
		{
			incrementHealth(-5);
		}
	}
	
	public int getArmor()
	{
		return armor;
	}
	
	public void setArmor(int armor)
	{
		this.armor = armor;
	}
	
	public int getHealth()
	{
		return health;
	}
	
	public void setHealth(int health)
	{
		this.health = health;
	}
	
	public int getMaxHealth()
	{
		return maxHealth;
	}
	
	public void setMaxHealth(int maxHealth)
	{
		this.maxHealth = maxHealth;
	}
	
	public int getDefensiveDamage()
	{
		return defensiveDamage;
	}
	
	public void setDefensiveDamage(int defensiveDamage)
	{
		this.defensiveDamage = defensiveDamage;
	}
	
	public void incrementArmor(int increment)
	{
		armor += increment;
	}
	
	public void incrementHealth(int increment)
	{
		health += increment;
	}
	
	public void incrementDefensiveDamage(int increment)
	{
		defensiveDamage += increment;
	}
	
	public void takeDamage(int i)
	{
		incrementHealth(-i);
	}
	
	public void heal(int i)
	{
		incrementHealth(i);
	}
	
	public GameTile getLocation()
	{
		return PlayableMapping.getPlayableMapping().getLocationOfStructure(this);
	}

	public void accept(PlayableVisitor pv)
	{
		pv.visitStructure(this);
	}
	
}
